package cn.buk.tms.dao;

import cn.buk.tms.entity.misc.Passenger;
import cn.buk.tms.sc.SearchCustomerCriteria;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: william
 * Date: 13-8-29
 * Time: 上午10:09
 * To change this template use File | Settings | File Templates.
 */
public interface PassengerDao {

    int create(Passenger passenger);

    int savePsgInfo(Passenger psgInfo);

    Passenger getById(int id);

    List<Passenger> getAll(int enterpriseId);

    List<Passenger> searchPsgInfo(int enterpriseId, SearchCustomerCriteria sc, List<Integer> allowedCustomerIds);

    List<Passenger> searchByNameCn(int enterpriseId, int customerId, String nameCn);

    List<Passenger> searchByNameEn(int enterpriseId, int customerId, String nameEn);

    List<Passenger> searchByName(int enterpriseId, int customerId, String name);

    int update(Passenger passenger);

    int delete(Passenger passenger);

    int deletePassengerById(int enterpriseId, int psgId);

    List<Passenger> searchPsgInfoMobileIsNull(int enterpriseId, int max);

    List<Passenger> searchPsgInfoFirstNameIsNull(int enterpriseId, int max);

    /**
     * 修改企业员工信息的手机号
     *
     * @param enterpriseId
     * @param username
     * @param psgId        员工信息id
     * @param mobile       手机号
     * @return
     */
    int updatePassengerMobile(int enterpriseId, String username, int psgId, String mobile);

    /**
     * 修改企业员工信息的firstName/lastName
     *
     * @param enterpriseId
     * @param username
     * @param psgId
     * @param firstName
     * @param lastName
     * @return
     */
    int updatePassengerFirstName(int enterpriseId, String username, int psgId, String firstName, String lastName);

    /**
     * 保存乘机人和机票私有政策的关联
     * @param enterpriseId
     * @param username
     * @param psgId
     * @param policyId
     * @return
     */
    int savePassenger2FlightKeyCustomerPolicy(int enterpriseId, String username, int psgId, int policyId);

    int removePassengerFlightPolicy(int enterpriseId, String username, int psgId, int policyId);
}
